use port_selector::{self, select_free_port, Selector};

#[tauri::command]
pub fn get_free_port(min: u16, max: u16) -> Option<u16> {
    let selector = Selector {
        check_tcp: true,
        check_udp: true,
        port_range: (min, max),
        max_random_times: 100,
    };
    select_free_port(selector)
}
